blkif_first_sect(req->frame_and_sects[i]) + 1
) << SECTOR_SHIFT;
start = blkif_first_sect(req->frame_and_sects[i]) << SECTOR_SHIFT;
-/*
-if (( gblock != 0 ) && ( writable == 0 )) printf("*");
-*/
+
DPRINTF("ParallaxWrite: sect: %lld (%ld,%ld), "
"vblock %llx, gblock %llx, "
"size %lx\n",
printf("]\n] STRANGE WRITE!\n]\n");
goto err;
}
-/* Disable write-in-place till radix is sorted out.
+
if (( gblock == 0 ) || ( writable == 0 )) {
-*/
+
gblock = allocblock(spage);
vdi_update_block(vdi, vblock, gblock);
-#if 0
+
} else {
/* write-in-place, no need to change mappings. */
writeblock(gblock, spage);
}
-#endif
+
}
rsp = (blkif_response_t *)req;
*/
u64 lookup(int height, u64 root, u64 key) {
radix_tree_node node;
+ u64 mask = ONE;
assert(key >> height == 0);
return ZERO;
root = node[(key >> height) & RADIX_TREE_MAP_MASK];
+ mask &= root;
freeblock(node);
if (height == 0)
- return root;
+ return ( root & ONEMASK ) | mask;
height -= RADIX_TREE_MAP_SHIFT;
}
gblock = lookup(VDI_HEIGHT, vdi->radix_root, vdi_block);
if (writable != NULL) *writable = iswritable(gblock);
-printf("lu: root: %11Ld, gblock: %11Ld, id: %11Ld, wr: %Ld\n",
- vdi->radix_root, gblock, getid(gblock), iswritable(gblock));
return getid(gblock);
}
sid = vdi->snap;
sid.index--;
- //printf("%6s%4s%21s %12s\n", "Block", "idx", "timestamp", "radix root");
- printf("%6s%4s%37s %12s\n", "Block", "idx", "timestamp", "radix root");
+ //printf("%8s%4s%21s %12s\n", "Block", "idx", "timestamp", "radix root");
+ printf("%8s%4s%37s %12s\n", "Block", "idx", "timestamp", "radix root");
while (sid.block != 0) {
blk = snap_get_block(sid.block);
}
t = ctime(&blk->snaps[i].timestamp.tv_sec);
t[strlen(t)-1] = '\0';
- //printf("%6Ld%4u%14lu.%06lu %12Ld\n",
- printf("%6Ld%4u%30s %06lu %12Ld\n",
+ //printf("%8Ld%4u%14lu.%06lu %12Ld\n",
+ printf("%8Ld%4u%30s %06lu %12Ld\n",
sid.block, i,
//blk->snaps[i].timestamp.tv_sec,
t,